package org.keyroy.mapEditor.ui.dialogs;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.CoolBar;
import org.eclipse.swt.widgets.CoolItem;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;

public class AnimationGroupSetDialog extends Shell {
	private Text text;
	private Table table;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String args[]) {
		try {
			Display display = Display.getDefault();
			AnimationGroupSetDialog shell = new AnimationGroupSetDialog(display);
			shell.open();
			shell.layout();
			while (!shell.isDisposed()) {
				if (!display.readAndDispatch()) {
					display.sleep();
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the shell.
	 * @param display
	 */
	public AnimationGroupSetDialog(Display display) {
		super(display, SWT.DIALOG_TRIM);
		setText("\u52A8\u753B\u7EC4\u8BBE\u7F6E");
		setImage(SWTResourceManager.getImage(AnimationGroupSetDialog.class, "/res/icons/ant_buildfile.gif"));
		setSize(420, 320);
		setLayout(new FormLayout());
		
		Composite composite = new Composite(this, SWT.NONE);
		FormData fd_composite = new FormData();
		fd_composite.left = new FormAttachment(0, 10);
		fd_composite.right = new FormAttachment(100, -10);
		fd_composite.top = new FormAttachment(0, 10);
		composite.setLayoutData(fd_composite);
		
		Label lblNewLabel = new Label(composite, SWT.NONE);
		lblNewLabel.setBounds(0, 3, 71, 17);
		lblNewLabel.setText(" \u52A8\u753B\u7EC4\u540D\u79F0 : ");
		
		text = new Text(composite, SWT.BORDER);
		text.setBounds(77, 0, 317, 23);
		
		table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION);
		FormData fd_table = new FormData();
		fd_table.top = new FormAttachment(composite, 6);
		fd_table.right = new FormAttachment(composite, 0, SWT.RIGHT);
		fd_table.left = new FormAttachment(0, 10);
		table.setLayoutData(fd_table);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		
		ToolBar toolBar = new ToolBar(this, SWT.FLAT | SWT.RIGHT);
		fd_table.bottom = new FormAttachment(toolBar, -6);
		
		TableColumn tblclmnNewColumn = new TableColumn(table, SWT.NONE);
		tblclmnNewColumn.setWidth(100);
		tblclmnNewColumn.setText("\u52A8\u753B\u540D\u79F0");
		
		TableColumn tblclmnData = new TableColumn(table, SWT.NONE);
		tblclmnData.setWidth(286);
		tblclmnData.setText("\u6E90");
		FormData fd_toolBar = new FormData();
		fd_toolBar.bottom = new FormAttachment(100, -10);
		fd_toolBar.right = new FormAttachment(composite, 0, SWT.RIGHT);
		toolBar.setLayoutData(fd_toolBar);
		
		ToolItem tltmNewItem = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem.setImage(SWTResourceManager.getImage(AnimationGroupSetDialog.class, "/res/icons/add_obj.gif"));
		tltmNewItem.setText("\u6DFB\u52A0");
		
		ToolItem tltmNewItem_1 = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem_1.setImage(SWTResourceManager.getImage(AnimationGroupSetDialog.class, "/res/icons/remove_correction.gif"));
		tltmNewItem_1.setText("\u5220\u9664");
		
		ToolItem tltmNewItem_3 = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem_3.setImage(SWTResourceManager.getImage(AnimationGroupSetDialog.class, "/res/icons/debugt_obj.gif"));
		tltmNewItem_3.setText("\u8BBE\u7F6E");
		createContents();
	}

	/**
	 * Create contents of the shell.
	 */
	protected void createContents() {

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}
